<template>
  <div class="introduction">
    <div class="introduction_title">
      <p style="margin-right: 20px">{{ lessonIntroductionData.title }}</p>
    </div>
    <!-- <div class="introduction_section">
      <div class="introduction_section_nav">任课教员</div>
      <div class="introduction_section_img">
        <div
          class="introduction_section_img_people"
          v-for="(item, index) in 3"
          :key="index"
        >
          <img src="" alt="" />
          <p>王老师</p>
        </div>
      </div>
    </div> -->
    <div class="introduction_section">
      <div class="introduction_section_nav">教学条件</div>
      <div class="introduction_section_content">
        <p v-html="lessonIntroductionData.content"></p>
      </div>
    </div>
  </div>
</template>

<script>
import { findLessonIntroductionById } from "@/api/resource";
export default {
  name: "introduction",
  data() {
    return {
      routerName: "",
      lessonIntroductionData: {},
    };
  },
  created() {
    this.routerName = this.$route.query.routerName;
  },
  mounted() {
    this.findLessonIntroductionById();
  },
  methods: {
    findLessonIntroductionById() {
      findLessonIntroductionById(this.$route.query.lessonIntroductionId).then(
        (response) => {
          if (response.data.code === 20000) {
            const { createdAt, title, content, conditions, type } =
              response.data.results;
            this.lessonIntroductionData = {
              createdAt,
              title,
              content,
              conditions,
              type,
            };
          }
        }
      );
    },
  },
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.introduction {
  color: #333;
  .introduction_nav {
    display: flex;
  }
  .introduction_list {
    padding: 0 40px;
    font-weight: bold;
    color: #333;
    background: white;
    height: 40px;
    line-height: 40px;
    border: 1px solid #f1f1f1;
    cursor: pointer;
    &:hover {
      color: #0a7b19;
      background: #f4fff6;
    }
  }
  .is_introduction_list {
    color: #0a7b19;
    background: #f4fff6;
    padding: 0 40px;
    font-weight: bold;
    height: 40px;
    line-height: 40px;
    border: 1px solid #f1f1f1;
    cursor: pointer;
  }

  .introduction_title {
    // margin-top: 20px;
    height: 40px;
    background: #f1f1f1;
    text-align: right;
    line-height: 40px;
    font-weight: bold;
    font-size: 21px;
    color: #0a7b19;
  }
  .introduction_section {
    padding: 20px 0;
    &:last-child {
      margin-bottom: 30px;
    }
    .introduction_section_nav {
      border-left: 3px solid #0a7b19;
      font-weight: bold;
      padding-left: 10px;
    }
    .introduction_section_img {
      display: flex;
      flex-wrap: wrap;
      margin-top: 16px;
      .introduction_section_img_people {
        margin-right: 20px;
        text-align: center;
        img {
          width: 120px;
          height: 160px;
          background-color: #f1f1f1;
        }
        p {
          width: 100%;
          height: 30px;
          line-height: 30px;
        }
      }
    }
    .introduction_section_content {
      p {
        margin-top: 16px;
        line-height: 24px;
      }
    }
  }
}
</style>
